package com.bdv.md.model;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table (name = "MAP_TBL")
@DynamicInsert
@DynamicUpdate
public class MapTbl extends BaseObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Integer mapId;
	private String meterId;
	private String msisdn;
	private String tipeMeter;
	private String tipePlg;
	private Integer tipePu;
	private Integer interval;
	private Boolean keran;
	
	public MapTbl(){
	}

	public MapTbl(Integer mapId){
		this.mapId = mapId;
	}
	
	public MapTbl(String meterId, String msisdn, String tipeMeter, String tipePlg, Integer tipePu) {
		this.meterId = meterId;
		this.msisdn = msisdn;
		this.tipeMeter = tipeMeter;
		this.tipePlg = tipePlg;
		this.tipePu = tipePu;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "MAP_ID")
	public Integer getMapId() {
		return mapId;
	}
	public void setMapId(Integer mapId) {
		this.mapId = mapId;
	}
	

	@Column(name = "METER_ID")
	public String getMeterId() {
		return meterId;
	}
	public void setMeterId(String meterId) {
		this.meterId = meterId;
	}

	@Column(name = "MSISDN")
	public String getMsisdn() {
		return msisdn;
	}
	public void setMsisdn(String msisdn) {
		this.msisdn = msisdn;
	}

	@Column(name = "TIPE_METER")
	public String getTipeMeter() {
		return tipeMeter;
	}
	public void setTipeMeter(String tipeMeter) {
		this.tipeMeter = tipeMeter;
	}

	@Column(name = "TIPE_PLG")
	public String getTipePlg() {
		return tipePlg;
	}
	public void setTipePlg(String tipePlg) {
		this.tipePlg = tipePlg;
	}

	@Column(name = "TIPE_PU")
	public Integer getTipePu() {
		return tipePu;
	}
	public void setTipePu(Integer tipePu) {
		this.tipePu = tipePu;
	}

	@Column(name = "JOB_INTERVAL")
	public Integer getInterval() {
		return interval;
	}

	public void setInterval(Integer interval) {
		this.interval = interval;
	}

	@Column(name = "KERAN")
	public Boolean getKeran() {
		return keran;
	}

	public void setKeran(Boolean keran) {
		this.keran = keran;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((mapId == null) ? 0 : mapId.hashCode());
		result = prime * result + ((meterId == null) ? 0 : meterId.hashCode());
		result = prime * result + ((msisdn == null) ? 0 : msisdn.hashCode());
		result = prime * result
				+ ((tipeMeter == null) ? 0 : tipeMeter.hashCode());
		result = prime * result
				+ ((tipePlg == null) ? 0 : tipePlg.hashCode());
		result = prime * result + ((tipePu == null) ? 0 : tipePu.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MapTbl other = (MapTbl) obj;
		if (mapId == null) {
			if (other.mapId != null)
				return false;
		} else if (!mapId.equals(other.mapId))
			return false;
		if (meterId == null) {
			if (other.meterId != null)
				return false;
		} else if (!meterId.equals(other.meterId))
			return false;
		if (msisdn == null) {
			if (other.msisdn != null)
				return false;
		} else if (!msisdn.equals(other.msisdn))
			return false;
		if (tipeMeter == null) {
			if (other.tipeMeter != null)
				return false;
		} else if (!tipeMeter.equals(other.tipeMeter))
			return false;
		if (tipePlg == null) {
			if (other.tipePlg != null)
				return false;
		} else if (!tipePlg.equals(other.tipePlg))
			return false;
		if (tipePu == null) {
			if (other.tipePu != null)
				return false;
		} else if (!tipePu.equals(other.tipePu))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "MapTbl [mapId=" + mapId + ", meterId=" + meterId + ", msisdn="
				+ msisdn + ", tipe_meter=" + tipeMeter + ", tipe_plg="
				+ tipePlg + ", tipe_pu=" + tipePu 
				+ "]";
	}

	
}
